﻿@model PortfolioApp.Web.Models.PostDetailVM

<div class="row">
    <div class="col-xs-12">
        <form method="post" class="form-group">
            <input class="form-control" value="@Model.Post.Title" name="Title" placeholder="Title..." />
            <input class="form-control" value="@Model.Post.Comment" name="Comment" placeholder="Comment..." />
            <input type="hidden" value="@Model.Post.Id" name="Id" />
            <input class="form-control btn btn-success" type="submit" value="Save" /><br />
        </form>
        @if (@Model.Post.Id > 0)
        {
            <input class="form-control btn btn-success" type="button" value="Cancel" onclick="location.href='/MVC/PostDetail/@Model.Post.Id'" /><br />
            <form method="post" action="/MVC/DeletePost" class="form-group">
                <input class="form-control btn btn-warning" type="submit" value="Delete" />
                <input type="hidden" value="@Model.Post.Id" name="id" />
            </form>
        }
        else
        {
            <input class="form-control btn btn-success" type="button" value="Cancel" onclick="location.href='/MVC/Index'" /><br />
        }
    </div>

</div>
